<?php
$db_class = pc_base::load_model('classmany_model');
$db_team = pc_base::load_model('team_model');
$db_people = pc_base::load_model('people_model');
?>
{template "content","header"}

<!-- header -->
<header class="header bg2 clearfix">
	<h3>
	{if $type==1}
	<a href="{APP_PATH}" title="返回上一级">
	{else}
	<a href="list-2-1.html" title="返回上一级">
	{/if}
	<img src="{IMG_PATH2}icon/back.png" alt="返回上一级"></a></h3>
	<form action="{SEARCH_PATH}" method="get" id="searchForm">
		<input type="hidden" name="m" value="search">
		<input type="hidden" name="type" value="{$type}">
		<input type="text" name="q" class="text2" placeholder="搜课程、搜导师、搜机构" value="{$q}">
		<input type="submit" class="btnSubmit2" id="btnSubmit2" value="搜索">
	</form>
</header>
<!-- / header -->
<div class="h_48"></div>

<!-- main -->
<main class="main">
{if !$q}
	<section class="searchPage">
		<div class="t2">热门搜索</div>
		<ul class="oList8 clearfix"></ul>
	</section>
{else}
	<div class="content">
		<ul class="nav_course1 border1 clearfix">
			<li><a href="{SEARCH_PATH}&t=1&q={$q}"{if $t==1} class="cur"{/if}>找课程</a></li>
			<!-- <li><a href="{SEARCH_PATH}&t=2&q={$q}"{if $t==2} class="cur"{/if}>找视频</a></li> -->
			<li><a href="{SEARCH_PATH}&t=3&q={$q}"{if $t==3} class="cur"{/if}>找导师</a></li>
			<li><a href="{SEARCH_PATH}&t=4&q={$q}"{if $t==4} class="cur"{/if}>找机构</a></li>
		</ul>
		<div class="tab_con">
			<div class="searcht1">共搜索到<em id="number">{php echo count($arr)}</em>个结果</div>
{if $t==1 || $t==2}
			<ul class="oListclass">
{loop $arr $c_one}
{php $team=$db_team->pkhs($c_one[one_team])}
{php $teacher=$db_people->pkhs($c_one[one_teacher])}
				<li><a href="{$c_one[url]}">
					<div class="oListclasstime">
						<span class="time1 fl">{date('Y-m-d',$c_one[class_time1])}</span>
						<span class="peo fr">{$c_one[num_view]}</span>
					</div>
					<div class="oListclasscon clearfix">
						<div class="pic1 fl"><img src="{$c_one[thumb]}"><em>席位：{$c_one[student_limit]}</em></div>
						<div class="oListclasscon_rg">
							<div class="oListclasscon_rg_t">{$c_one[title]}</div>
							<div class="oListclasscon_rg_name">{$team[title]}<i class="icon_v"></i></div>
							<div class="oListclasscon_rg_teacher clearfix">
								<!-- <span class="fl">讲师：{$teacher[title]}</span> -->
								<div class="oListclasscon_rg_teacher_price fl"><em>{price2cn($c_one[price_base])}</em>
									{if $c_one[price_cut]}
										<i>￥{price2cn($c_one[price_cut])}</i>
									{else}
										<i class="free">免费</i>
									{/if}
									
								</div>


							</div>
						</div>
					</div>
				</a></li>
{/loop}
			</ul>
{elseif $t==3}
			<ul class="oList_daoshi" >
{loop $arr $r}
			<li>
				<a href="{$r[url]}" class="clearfix">				
					<img src="{$r[thumb]}" class="oListdsImg fl">				
					<div class="oListdsCon">
						<div class="oListdsCon1 clearfix">{$r[title]}<em class="fr">{$r[goodjob]}</em></div>
						<div class="oListdsTxt ellipsis">{$r[con]}</div>
						<div class="yuejianzt clearfix">
						<?php
							$db_member = pc_base::load_model('apply_expert_model');
							$num=$db_member->count('a_id='.$r['id']);
							$passnum=$db_member->count('a_id='.$r['id'].' and status=1');
						?>
							<span class="icon_heart">{$num}人想约</span>
							<span class="icon_yyj">{$passnum}人成功预约</span>
						</div>
						<div class="ds_biaoqian clearfix">
						<?php if (strpos($r['type'], '1') !== false) {?>
					    <i class="icon_t"></i>
					    <?php }?>
					    <?php if (strpos($r['type'], '2') !== false) {?>
					    <i class="icon_j"></i>
					    <?php }?>
					    <?php if (strpos($r['type'], '3') !== false) {?>
					    <i class="icon_r"></i>
					    <?php }?>
							
						</div>
					</div>
				</a>
			</li>
{/loop}
			</ul>
{elseif $t==4}
			<ul class="guanzhulist" >
{loop $arr $one}
				<li class="clearfix">
				<div class="photo fl"><img src="{$one[thumb]}"></div>
				<div class="guanzhulist_con fl">
					<div class="p_name">{$one[title]}<i></i><span class="ellipsis">{$one[small_content]}</span></div>
					<div class="guanzhulist_con_pic clearfix">{php echo $db_class->get('one_team',$one['id'])}</div>
				</div>
				<div class="guanzhulist_con_rg fr">
					<a href="javascript:void(0);" class="d_guan js_like" data-catid="{$one[catid]}" data-id="{$one[id]}">关注</a>
					<a href="{$one[url]}" class="gz_more">&nbsp;</a>
				</div>
			</li>
{/loop} 
		</ul>
		</div>
	</div>
{/if}
{/if}
</main>
<!-- / main -->
<div class="h_48"></div>

{template "content","footer"}